how to calculate costs